<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <table border="1px" style="text-align: center;">
        <thead>
            <tr>
                <td>茶叶ID</td>
                <td>茶叶名称</td>
                <td>茶叶类型</td>
                <td>茶叶库存</td>
            </tr>
        </thead>
    </table>
    <tbody></tbody>
    </tbody>
    <script>
        //渲染
        function apply() {
            new Promise((res, rej) => {
                var xhr = new XMLHttpRequest()
                xhr.open("GET", "https://liu.zzgoodqc.cn/teas")
                xhr.responseType = "json"
                xhr.send()
                xhr.onload = (ab) => {
                    console.log(ab);         
                }
            }).then((b) => {
                console.log(b);
            }).catch((a) => {
                console.log(a);
            })
        }
        apply()
    </script>
</body>

</html>